#include<iostream>
int compare(const void * a, const void * b){
    return (*(int*)a - *(int*)b);
}
int main(){
    int nums[500];
    int nums_odd[500];
    int n;
    int odd_length = 0;
    scanf("%d", &n);
    if(n < 1 || n > 500){
        printf("error");
        return 0;
    }
    for(int i = 0; i < n; i++){
        scanf("%d", &nums[i]);
        if(nums[i] < -50000 || nums[i] > 50000){
            printf("error");
            return 0;
        }
        if(nums[i] % 2 != 0){
            nums_odd[odd_length++] = nums[i];
        }
    }
    qsort(nums_odd, odd_length, sizeof(int), compare);
    odd_length = 0;
    for(int i = 0; i < n; i++){
        if (nums[i] % 2 != 0)
        {
            nums[i] = nums_odd[odd_length++];
        }
        i == (n - 1) ? printf("%d", nums[i]) : printf("%d  ", nums[i]);
    }
    return 0;
}